<script lang="ts">
export default {
  name: "sentiment",
};
</script>
<template>
  <div class="page-box h100 display-flex czbj">
    <n-tabs type="line">
      <n-tab-pane name="GetProfitList" tab="达人收益榜">
        <FormTemplate url="dc/GetHotList?type=1" :columns="columnssi" :colRight="colRightsi" observetype="16">
        </FormTemplate>
      </n-tab-pane>
      <n-tab-pane name="ListPopular" tab="人气榜">
        <FormTemplate url="dc/sentiment" :columns="columns" :colRight="colRight" observetype="14"></FormTemplate>
      </n-tab-pane>
      <n-tab-pane name="SoaringList" tab="飙升榜">
        <FormTemplate url="dc/sentiment?type=1" :columns="columnser" :colRight="colRighter" observetype="15">
        </FormTemplate>
      </n-tab-pane>
      <n-tab-pane name="GetHotList" tab="热股">
        <FormTemplate url="dc/GetHotList" :columns="columnssan" :colRight="colRightsan" observetype="16"></FormTemplate>
      </n-tab-pane>
    </n-tabs>
  </div>
</template>
<script lang='ts' setup>
import { h } from "vue";
import comp from "../../components/index";
import FormTemplate from "../../components/details/FormTemplate";
let columns = [
  {
    title: "排名",
    key: "rk",
    width: 60,
    align: "center",
  },
];
let colRight = [
  {
    title: "操作",
    align: "center",
    key: "actions",
    render(row) {
      row.secCode = row.f12;
      return h(comp.MoreOperations, {
        obj: [
          {
            label: "添加人气榜单",
            key: "14",
          },
        ],
        rowData: row,
      });
    },
  },
];

let columnser = [
  {
    title: "排名",
    key: "rk",
    align: "center",
    width: 60,
  },
  {
    title: "飙升",
    key: "hrc",
    align: "center",
    width: 60,
  },
];
let colRighter = [
  {
    title: "操作",
    align: "center",
    key: "actions",
    render(row) {
      row.secCode = row.f12;
      return h(comp.MoreOperations, {
        obj: [
          {
            label: "添加飙升榜单",
            key: "15",
          },
        ],
        rowData: row,
      });
    },
  },
];

const columnssan = [
  {
    title: "排名",
    align: "center",
    width: 60,
    render(row, index) {
      return index + 1;
    },
  },
  {
    title: "情绪",
    align: "center",
    width: 60,
    children: [
      {
        title: "看多",
        key: "hrc",
        align: "center",
        width: 60,
        render(row) {
          return (row.more_rate * 100).toFixed(2) + "%";
        },
      },
      {
        title: "看空",
        key: "hrc",
        align: "center",
        width: 60,
        render(row) {
          return (row.bearish_rate * 100).toFixed(2) + "%";
        },
      },
      {
        title: "飙升",
        key: "rank_change",
        align: "center",
        width: 60,
      },
    ],
  },
];
let colRightsan = [
  {
    title: "操作",
    align: "center",
    key: "actions",
    render(row) {
      row.secCode = row.f12;
      return h(comp.MoreOperations, {
        obj: [
          {
            label: "添加热股榜单",
            key: "18",
          },
        ],
        rowData: row,
      });
    },
  },
];

const columnssi = [
  {
    title: "排名",
    align: "center",
    width: 60,
    render(row, index) {
      return index + 1;
    },
  },
  {
    title: "专家盈亏",
    align: "center",
    width: 60,
    children: [
      {
        title: "收益率",
        key: "profit",
        align: "center",
        width: 60,
        sorter: (row1, row2) => row1.profit - row2.profit,
        render(row) {
          return (row.profit * 100).toFixed(2) + "%";
        },
      },
      {
        title: "看多",
        key: "isBearish",
        align: "center",
        width: 60,
        sorter: (row1, row2) => row1.isBearish - row2.isBearish,
        render(row) {
          return row.isBearish ? "" : "✓";
        },
      },
      {
        title: "看空",
        key: "isBearish",
        align: "center",
        width: 60,
        sorter: (row1, row2) => row1.isBearish - row2.isBearish,
        render(row) {
          return row.isBearish ? "✓" : "";
        },
      },
      {
        title: "查看点评",
        key: "post_content",
        align: "center",
        width: 60,
        ellipsis: {
          tooltip: true
        }
      },
    ],
  },
];
let colRightsi = [
  {
    title: "操作",
    align: "center",
    key: "actions",
    render(row) {
      row.secCode = row.f12;
      return h(comp.MoreOperations, {
        obj: [
          {
            label: "添加达人收益榜单",
            key: "17",
          },
        ],
        rowData: row,
      });
    },
  },
];
</script>
<style scoped></style>